package com.zeyi.chat.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author zeyi
 */
public class EmailUtil {
    private static final Pattern regex =
            Pattern.compile("^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$");

    public static boolean checkEmail(String email) {
        Matcher matcher = regex.matcher(email);
        return matcher.matches();
    }
}
